import ReactDOM from 'react-dom/client'
import './index.css'
import { createHashRouter, RouterProvider } from 'react-router-dom'
import Order from './pages/Order/Order'
import Login from './pages/Login/Login'
import { Card, CardContent, CardHeader } from './components/ui/card'
import { Auth } from './components/auth/Auth'
import { Toaster } from '@/components/ui/toaster'

const router = createHashRouter([
  {
    path: '/',
    element: (
      <Auth>
        <Order />
      </Auth>
    ),
  },
  {
    path: '/login',
    element: <Login />,
  },
])

ReactDOM.createRoot(document.getElementById('root')!).render(
  <div className="flex justify-center mt-8">
    <Card className="w-[960px]">
      <CardHeader className="text-center">订单发货模拟发货系统</CardHeader>
      <CardContent>
        <RouterProvider router={router} />
      </CardContent>
      <Toaster />
    </Card>
  </div>
)
